#ifndef CALCULATOR_H
#define CALCULATOR_H

#include <QWidget>
#include <QGridLayout>
#include <QPushButton>
#include <QLabel>
#include <QFont>
#include <QMenu>
#include <QKeyEvent>

QT_BEGIN_NAMESPACE
namespace Ui {
class Calculator;
}
QT_END_NAMESPACE

class Calculator : public QWidget
{
    Q_OBJECT

public:
    Calculator(QWidget *parent = nullptr);
    ~Calculator();

private:

    QGridLayout* gridlayout;

    QLabel* resultLabel;

    QPushButton* number_0;
    QPushButton* number_1;
    QPushButton* number_2;
    QPushButton* number_3;
    QPushButton* number_4;
    QPushButton* number_5;
    QPushButton* number_6;
    QPushButton* number_7;
    QPushButton* number_8;
    QPushButton* number_9;

    QPushButton* plus_minus;
    QPushButton* plus;
    QPushButton* minus;
    QPushButton* multiplication;
    QPushButton* division;
    QPushButton* percent;
    QPushButton* square_root;
    QPushButton* square_degree;
    QPushButton* oneDivisionX;

    QPushButton* Button_C;
    QPushButton* Button_Point;
    QPushButton* Button_Equal;
    QPushButton* Button_DeleteLastNumber;

    QPushButton* Menu;
    QMenu* MenuFromButton;
    //////////////////
    QAction* themeMenu; //
    QAction* lightAction; //
    QAction* darkAction;  //
    //////////////////
    QAction* closeAction;


    double numFirst;

    void building();
    void setup();
    void connecting();

    void LightTheme();
    void DarkTheme();

    virtual void keyPressEvent(QKeyEvent*);

private slots:
    void connectNumbers();
    void connectMathOperations();
    void connectAdditionalOperations();
    void connectMenuActions();

private:
    Ui::Calculator *ui;
};
#endif // CALCULATOR_H
